package com.jumper.study.admin.dto.resp;

import java.util.ArrayList;
import java.util.List;

public class LessonCategoryResp {
    private Integer id;

    private String title;

    private Integer parentId;

    private Integer sort;

    private List<LessonCategoryResp> children;

    public LessonCategoryResp(Integer id, String title, Integer parentId, Integer sort) {
        this.id = id;
        this.title = title;
        this.parentId = parentId;
        this.sort = sort;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public List<LessonCategoryResp> getChildren() {
        return children;
    }

    public void setChildren(List<LessonCategoryResp> children) {
        this.children = children;
    }
    
    public void addChild(LessonCategoryResp child) {
        if (children == null) {
            children = new ArrayList<>();
        }
        this.children.add(child);
    }
}
